import * as types from '../mutation-types'

// initial state
const state = {
  relatedFormInfo: {},
  isRelatedModalEdit: false
}

// getters
const getters = {
  getRelatedFormInfo: state => state.relatedFormInfo,
  getIsRelatedModalEdit: state => state.isRelatedModalEdit
}

// actions
const actions = {
  setRelatedFormInfo ({commit}, setRelatedForm) {
    commit(types.SET_RELATED_FORM_DATA, setRelatedForm)
  },
  setIsRelatedModalEdit ({commit}, setIsRelatedEdit) {
    commit(types.SET_IS_RELATED_FORM_DATA, setIsRelatedEdit)
  }
}

// mutations
const mutations = {
  [types.SET_RELATED_FORM_DATA] (state, relatedFormInfo) {
    state.relatedFormInfo = relatedFormInfo
  },
  [types.SET_IS_RELATED_FORM_DATA] (state, isRelatedModalEdit) {
    state.isRelatedModalEdit = isRelatedModalEdit
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
